\Rdversion{1.1}
\name{DayCountConventions}

\concept{Day Count Conventions}

\alias{DayCountConventions}

\alias{isLeapYear}
\alias{isLeapYearBetween}
\alias{getLeapYearPeriod}

\alias{yearCount}
\alias{yearFraction}

\alias{dayCount30}
\alias{dayCount30S}
\alias{dayCountActual}
\alias{dayCountActualNoLeap}
\alias{dayCountActualISDA}
\alias{dayCount30U}

\alias{periodCount360}
\alias{periodCount365}
\alias{periodCount365L}
\alias{periodCountActualISDA}
\alias{periodCountActualISMA}
\alias{periodCountActualISMAUltimo}


\alias{accruedInterest}



\title{
Day Count Conventions
}
\description{
Day Count Conventions
}
\usage{
isLeapYear(Year)
isLeapYearBetween(InterestStartDate,InterestEndDate)
getLeapYearPeriod(InterestStartDate,InterestEndDate)

yearCount(StartDate,EndDate)
yearFraction(StartDate,EndDate)

dayCount30(InterestStartDate,InterestPayDate)
dayCount30S(InterestStartDate,InterestPayDate)
dayCountActual(InterestStartDate,InterestPayDate)
dayCountActualNoLeap(InterestStartDate,InterestPayDate)
dayCountActualISDA(InterestStartDate,InterestPayDate)
dayCount30U(InterestStartDate,InterestPayDate)

periodCount360(Frequency)
periodCount365(Frequency)
periodCount365L(Frequency,InterestStartDate,InterestEndDate)
periodCountActualISDA(Frequency)
periodCountActualISMA(Frequency,InterestStartDate)
periodCountActualISMAUltimo(Frequency,InterestStartDate)

accruedInterest(Rate,DayCountConvention,Frequency,InterestStartDate,InterestPayDate,InterestEndDate)

}

\arguments{
  \item{Year}{a vector or scalar of class numeric e.g. \code{2000:2020}
}
  \item{Frequency}{Payment frequency e.g. 1, 2, 4, 6, 12
}
  \item{InterestStartDate}{Period start date e.g. \code{DateYMD(2009,11,30)} 
}
  \item{InterestEndDate}{
Period end date e.g. \code{DateYMD(2010,11,30)} 
}
  \item{InterestPayDate}{Payment date e.g. \code{DateYMD(2010,6,15)}
}
  \item{DayCountConvention}{The day count convention e.g. \code{"30/360"} see Details for all possible conventions
}
\item{Rate}{Interest Rate, Coupon Rate expressed in annual terms e.g. \code{4.25} for an annual Rate of 4.25\%
}
\item{StartDate}{Period start date e.g. \code{DateYMD(2009,11,30)} 
}
\item{EndDate}{Period end date e.g. \code{DateYMD(2020,11,30)} 
}


}
\details{
The following Day Count Conventions are implemented.
\tabular{ll}{
	30/360   \tab German: 30/360\cr
    30U/360  \tab US 30/360\cr
    30S/360  \tab Special German\cr
    ActualISDA/ActualISDA   \tab ISDA: Act/Act \cr
    Actual/365L   \tab Actual/365L \cr
    Actual/365     \tab Actual/365\cr
    Actual/360  \tab Actual/360\cr
    Actual/ActualISMA \tab ISMA Act/Act\cr
	Actual/ActualISMAUltimo \tab ISMA Act/Act Ultimo
}



}
\value{
%%  ~Describe the value returned
%%  If it is a LIST, use
%%  \item{comp1 }{Description of 'comp1'}
%%  \item{comp2 }{Description of 'comp2'}
%% ...
}
\references{
Wikipedia, day count convention\cr
\url{http://en.wikipedia.org/wiki/Day_count_convention}

ISDA - International Swaps and Derivatives Association, Inc.\cr
\url{http://www.isda.org}

SWX Swiss Exchange, accrued Interest & Yield Calculations and Determination of Holiday Calendars\cr
\url{http://www.six-swiss-exchange.com/download/trading/products/bonds/accrued_interest_en.pdf}
}
\author{
Roger Bergande \email{roger@bergande.ch}
}
\note{


}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
%% ~~objects to See Also as \code{\link{help}}, ~~~
}
\examples{
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as

}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{chron}
\keyword{utilities}
